package FactoryPattern;

import javax.annotation.Resource;

/**
 * @author liwuji
 * @date 2024/7/16
 * @desc
 **/
public class BoxColorFactory implements AbstractFactory{

    @Resource
    private ColorFactory colorFactory;
    @Resource
    private ShapeFactory shapeFactory;

    @Override
    public Box boxColor(Shape shape,Color color) {
        Color red = colorFactory.color("red");
        Shape shape1 = shapeFactory.getShape("renc");
        RedBox redBox = new RedBox();
        redBox.setColor(red);
        redBox.setShape(shape1);
        return redBox;
    }


}
